package cn.xopencode.recordservice.convert.drytransformer;

import cn.xopencode.common.framework.vo.PageResult;
import cn.xopencode.recordservice.dal.mysql.dataobject.drytransformer.KvDryTransformerRecordDO;
import cn.xopencode.recordservice.rpc.drytransformer.dto.DryTransformerRecordCreateDTO;
import cn.xopencode.recordservice.rpc.drytransformer.dto.DryTransformerRecordPageDTO;
import cn.xopencode.recordservice.rpc.drytransformer.dto.DryTransformerRecordUpdateDTO;
import cn.xopencode.recordservice.rpc.drytransformer.vo.DryTransformerRecordPageVO;
import cn.xopencode.recordservice.rpc.drytransformer.vo.DryTransformerRecordUpdateVO;
import cn.xopencode.recordservice.service.drytransformer.bo.DryTransformerRecordCreateBO;
import cn.xopencode.recordservice.service.drytransformer.bo.DryTransformerRecordPageBO;
import cn.xopencode.recordservice.service.drytransformer.bo.DryTransformerRecordUpdateBO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

@Mapper
public interface DryTransformerRecordConvert {

    DryTransformerRecordConvert INSTANCE = Mappers.getMapper(DryTransformerRecordConvert.class);

    KvDryTransformerRecordDO convert(DryTransformerRecordCreateBO bean);

    DryTransformerRecordCreateBO convert(DryTransformerRecordCreateDTO bean);

    DryTransformerRecordPageBO convert(DryTransformerRecordPageDTO bean);

    @Mapping(source = "records", target = "list")
    PageResult<DryTransformerRecordPageVO> convertPage(IPage<KvDryTransformerRecordDO> page);

    DryTransformerRecordUpdateVO convertUpdate(KvDryTransformerRecordDO bean);

    DryTransformerRecordUpdateBO convert(DryTransformerRecordUpdateDTO bean);

    KvDryTransformerRecordDO convert(DryTransformerRecordUpdateBO bean);

}
